package com.tang.configuration;

import com.tang.support.spring.SpringUtils;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;

/**
 * 定时任务的java配置，把相关的bean放到spring容器中进行管理
 *
 * @author cfpu003
 */
// @Configuration标注在类上，相当于把该类作为spring的xml配置文件中的<beans>，作用为：配置spring容器(应用上下文)
@Configuration //这个注解的信息请参考https://www.cnblogs.com/duanxz/p/7493276.html
public class QuartzConfig {

    @Bean
    public SpringUtils springUtils() {
        SpringUtils springUtils = new SpringUtils();
        return springUtils;
    }

    @Bean
    public SchedulerFactoryBean schedulerFactoryBean() {
        SchedulerFactoryBean schedulerFactoryBean = new SchedulerFactoryBean();
        return schedulerFactoryBean;
    }

}
